#include <ostream>
#include <iostream>
#include <string>

// 重载输出操作符 <<
template <class T, class U>
std::ostream &operator<<(std::ostream &os, const std::pair<T, U> &p)
{
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

// 重载左移操作符
template <class T, class U>
std::pair<T, U> operator<<(const std::pair<T, U> &val, int v)
{
    return {val.first << v, val.second << v};
}

int main(int, char **)
{
    std::cout << std::pair<int32_t, std::string>({1, "abcd"}) << std::endl;

    std::pair<int32_t, int32_t> pi(1, 2);
    std::pair<int32_t, int32_t> pr = pi << 2;
    std::cout << pr << " = " << pi << " << 2" << std::endl;
    std::cout << "hello";
    return 0;
}